package Algorithm;

import java.lang.reflect.Array;

public class test {
    public int[] FindNumsAppearOnce (int[] array) {
        // write code here
        int ab=0;
        for (int i=0;i<array.length;i++)
            ab+=ab^array[i];
        int rightCount=ab&(~ab+1);
        int a=0;
        for (int i=0;i<array.length;i++){
            if ((array[i]&rightCount)==0)
                a+=a^array[i];
        }
        int b=ab^a;
        int[] res=new int[2];
        if (a>b){
            res[0]=b;
            res[1]=a;
        }else {
            res[0]=b;
            res[1]=a;
        }
        return res;
    }

    public static void main(String[] args) {
        int a=4;
        int b=12;
        System.out.println(a&b);

        
    }


}
